<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_DefectItem.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/Ware/Ware_Location.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'LocaId',
            footer: "Foots",
            cnName: '库位管理',
            name: 'Ware/Ware_Location',
            url: "/Ware_Location/",
            sortName: "CreateDate"
        });
        const editFormFields = ref({ "LocaCode": "", "LocaName": "", "LocaSqure": "", "LocaWeight": "", "WareId": "", "ReserId": "", "LocaState": "", "LocaNote": "" });
        const editFormOptions = ref([[{ "title": "库位编号", "field": "LocaCode", "type": "text" }],
        [{ "title": "库位名称", "required": true, "field": "LocaName", "type": "text" }]
            , [{ "title": "面积", "required": true, "field": "LocaSqure", "type": "text" }]
            , [{ "title": "最大载重量", "required": true, "field": "LocaWeight", "type": "text" }]
            , [{ "dataKey": "Ware_ReservoirWareId", "data": [], "title": "所属仓库", "field": "WareId", "type": "select" }]
            , [{ "dataKey": "Ware_LocationReserId", "data": [], "title": "所属库区", "field": "ReserId", "type": "select" }]
            , [{ "dataKey": "Ware_ProductState", "data": [], "title": "状态", "field": "LocaState", "type": "radio" }]
            , [{ "title": "备注", "field": "LocaNote", "type": "textarea" }]]);
        const searchFormFields = ref({ "LocaCode": "", "LocaName": "", "LocaSqure": "", "LocaWeight": "", "WareId": "", "ReserId": "", "LocaState": "", "LocaNote": "" });
        const searchFormOptions = ref([[{ "title": "库位编号", "field": "LocaCode", "type": "like" }]
            ,[ { "title": "库位名称", "field": "LocaName", "type": "like" }]
            , [{ "title": "面积", "field": "LocaSqure", "type": "like" }]
            , [{ "title": "最大载重量", "field": "LocaWeight", "type": "like" }]
            , [{ "dataKey": "Ware_ReservoirWareId", "data": [], "title": "所属仓库", "field": "WareId", "type": "select" }]
            ,[ { "dataKey": "Ware_LocationReserId", "data": [], "title": "所属库区", "field": "ReserId", "type": "select" }]
            ,[ { "dataKey": "Ware_ProductState", "data": [], "title": "状态", "field": "LocaState", "type": "radio" }]
            , [{ "title": "备注", "field": "LocaNote", "type": "like" }]]);
        const columns = ref([{ field: 'LocaId', title: '库位管理主键', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'LocaCode', title: '库位编号', type: 'string', sort: true, width: 180, align: 'left', sort: true },
        { field: 'LocaName', title: '库位名称', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'LocaSqure', title: '面积', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'LocaWeight', title: '最大载重量', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'WareId', title: '所属仓库', type: 'string', bind: { key: 'Ware_ReservoirWareId', data: [] }, width: 120, align: 'left' },
        { field: 'ReserId', title: '所属库区', type: 'string', bind: { key: 'Ware_LocationReserId', data: [] }, width: 120, align: 'left' },
        { field: 'LocaState', title: '状态', type: 'int', bind: { key: 'Ware_ProductState', data: [] }, width: 110, align: 'left' },
        { field: 'LocaNote', title: '备注', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
